The History of Eliza
First there was a request for help with a [Chat Program] posted by Swirly. That led to a discussion about simulated online chatting. Chat to a computer and the computer answers? Hey, this sounds familiar. Eliza is the most famouse Artificial Intelligence program ever. It is also probably the oldest. Eliza was created in the early 1960's by MIT scientist [Joseph Weizenbaum]. The name Eliza was actually taken from My Fair Lady's Eliza Doolittle. Weizenbaum's original Eliza was a spoof of conversation between a psychoanalyst and a patient. Dr. Weizenbaum wrote this program as a spoof and was both amazed and embarrassed that it received so much attention. There are versions of [Eliza] in every BASIC language. Some variations have adopted the title Doctor rather than Eliza. It is simply not possible to discuss word parsing, searching and matching without being reminded of Eliza. And this was the case at the Liberty BASIC Forum as well.
And so the [challenge] was on: Write an Eliza program in a Chat Prototype.
The Rules
The Chat Prototype
Alyce offred a Chat - Type Interface that could be used
'** Created by LB Workshop - 2/9/2005 6:45:50 AM
'** Chat-Type Interface
True = 1 : False = 0
[InitColors]
'Please use default colors when possible.
'Use the following color statements only if necessary in the
program.
ForegroundColor$ = "white"
BackgroundColor$ = "darkgray"
TexteditorColor$ = "darkblue"
TextboxColor$ = "black"
' ComboboxColor$ = "White"
' ListboxColor$ = "White"
[WindowSetup]
NOMAINWIN
WindowWidth = 510 : WindowHeight = 370
UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
[ControlSetup]
statictext #main.s1, "Type here. Hit 'ENTER.'", 10, 260, 369, 25
statictext #main.s2, "Text is displayed here.", 10, 10, 369, 25
button #main.default, "Okay",[okay],UL, 380, 290, 105, 34
button #main.quit, "Quit",[quit],UL, 380, 40, 105, 34
textbox #main.type, 10, 290, 355, 34
texteditor #main.display, 10, 40, 355, 210
Open "Chat-Type Interface" for Dialog as #main
#main "trapclose [quit]"
#main "font ms_sans_serif 14 bold"
#main.display "!disable" 'user cannot type into display
box
[loop]
Wait
[quit]
close #main : END
[okay]
#main.type "!contents? txt$" 'get text typed by user
#main.display "You typed:" 'put message in texteditor
#main.display txt$ 'put user text into
texteditor
#main.type "" 'clear typing box
#main.type "!setfocus" 'set focus so typing goes into
textbox
wait
The Submissions
There were 3 submitted entries
[Doctor] by Norman
[ElizaII] by Rod
[Merlin] by Janet

The Similarities
All 3 entries used a dialog window with a default button so mouse clicking wasn't required. The wait time varies with each program, but each program uses a timer to elicit a computer response when no user input has been detected within that time frame. The 3 entries all used data statements and an array to store phrases for later searching. Each user-inputted string was searched using these keywords and the command instr.
The Differences
Norman's Doctor and Rod's Eliza II stayed the most true to the original Eliza. The approach was reflective, with keywords extracted from the user's text and restated in open ended statements.
[user] I am addicted to programming. [doctor] Do you think it's absolutely normal to be addicted to programming? [ElizaII] How long have you been addicted to programming?
Janet's answers were more specific.
[user] I had a dream about magicians. [Merlin] What does the dream suggest to you?
If no specific keyword is found, the program defaults to a general reflective statement.
[user] I am addicted to programming. [Merlin] Do you enjoy feeling addicted to programming?
Norman used a short pause between the typing of each letters to better simulate a 'real' person typing. Rod used a slighlty longer pause between letters for an even more realistic effect. Janet made use of John White's comal.dll to give speech to the program. Eliza was replaced with the speech agent, Merlin.
Rod definitely earned the Humor Award with his entry. Try entering
[user] Who are you?
and these are the answers you'll receive:
[Norman's Doctor] Do you often think about such questions? [Janet's Merlin] (No answer, bug in program causes program to hang) [Rod's Eliza] I'm just a locum shrink earning a buck, but I do care.
All in all, the programs were great fun. Try them yourself and see what the Doctor, ElizaII, and Merlin have to say to you. You're bound to be entertained.
Thanks, Alyce, for hosting this challenge!
The files ( doctor.bas, elizaII.bas and merlinAI.bas ) are included in the zipped archive of this newsletter.
::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::